package com.lx.patterns.combination;

/**
 * @ClassName MenuItem
 * @Description: //todo
 * @Author: 落雪
 * @CreateDate: 2025/1/26 14:35
 * @UpdateUser: 落雪
 * @UpdateDate: 2025/1/26 14:35
 * @UpdateRemark:
 * @Version: 1.0
 */
public class MenuItem  extends MenuComponent{

    public MenuItem(String name,int level) {
        this.name = name;
        this.level = level;
    }

    @Override
    public String getName() {
        return super.getName();
    }

    @Override
    public void print() {
        for (int i = 1; i < level; i++) {
            System.out.print("--");
        }
        System.out.println(name);
    }
}
